<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: yui   yui.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>yui&nbsp; <span class="subtitle">3.0.0b1</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_yui.html" title="yui">yui</a>
                
                 &gt; yui.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">_instances</span> <span class="o">=</span> <span class="o">{},</span> 
        <span class="nx">_startTime</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">().</span><span class="nx">getTime</span><span class="o">(),</span> 
        <span class="nx">p</span><span class="o">,</span> 
        <span class="nx">i</span><span class="o">,</span>

        <span class="nx">add</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nb">window</span><span class="o">.</span><span class="nx">addEventListener</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">,</span> <span class="nx">capture</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">addEventListener</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">,</span> <span class="o">(!!</span><span class="nx">capture</span><span class="o">));</span>
                <span class="o">};</span>
            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nb">window</span><span class="o">.</span><span class="nx">attachEvent</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">attachEvent</span><span class="o">(</span><span class="s2">&quot;on&quot;</span> <span class="o">+</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">);</span>
                <span class="o">};</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">function</span><span class="o">(){};</span>
            <span class="o">}</span>
        <span class="o">}(),</span>

        <span class="nx">remove</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nb">window</span><span class="o">.</span><span class="nx">removeEventListener</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">function</span> <span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">,</span> <span class="nx">capture</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">removeEventListener</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">,</span> <span class="o">!!</span><span class="nx">capture</span><span class="o">);</span>
                <span class="o">};</span>
            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nb">window</span><span class="o">.</span><span class="nx">detachEvent</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">function</span> <span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">detachEvent</span><span class="o">(</span><span class="s2">&quot;on&quot;</span> <span class="o">+</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">fn</span><span class="o">);</span>
                <span class="o">};</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">function</span><span class="o">(){};</span>
            <span class="o">}</span>
        <span class="o">}(),</span>

        <span class="nx">globalListener</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">windowLoaded</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">DOMReady</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="nx">remove</span><span class="o">(</span><span class="nb">window</span><span class="o">,</span> <span class="s1">&#39;load&#39;</span><span class="o">,</span> <span class="nx">globalListener</span><span class="o">);</span>
        <span class="o">},</span>

<span class="c">// @TODO: this needs to be created at build time from module metadata</span>
<span class="c"></span>
        <span class="nx">_APPLY_TO_WHITE_LIST</span> <span class="o">=</span> <span class="o">{</span>
            <span class="s1">&#39;io.xdrReady&#39;</span><span class="o">:</span> <span class="m">1</span><span class="o">,</span>
            <span class="s1">&#39;io.start&#39;</span><span class="o">:</span> <span class="m">1</span><span class="o">,</span>
            <span class="s1">&#39;io.success&#39;</span><span class="o">:</span> <span class="m">1</span><span class="o">,</span>
            <span class="s1">&#39;io.failure&#39;</span><span class="o">:</span> <span class="m">1</span>
        <span class="o">},</span>

        <span class="nx">SLICE</span> <span class="o">=</span> <span class="nb">Array</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">slice</span><span class="o">;</span>
        
<span class="c">// reduce to one or the other</span>
<span class="c"></span><span class="k">if</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">YUI</span> <span class="o">===</span> <span class="s1">&#39;undefined&#39;</span> <span class="o">||</span> <span class="o">!</span><span class="nx">YUI</span><span class="o">)</span> <span class="o">{</span>

    <span class="c">/**</span>
<span class="c">     * The YUI global namespace object.  If YUI is already defined, the</span>
<span class="c">     * existing YUI object will not be overwritten so that defined</span>
<span class="c">     * namespaces are preserved.  </span>
<span class="c">     *</span>
<span class="c">     * @class YUI</span>
<span class="c">     * @constructor</span>
<span class="c">     * @global</span>
<span class="c">     * @uses EventTarget</span>
<span class="c">     * @param o Optional configuration object.  This object is stored</span>
<span class="c">     * in YUI.config.  See config for the list of supported properties.</span>
<span class="c">     */</span>

    <span class="c">/*global YUI*/</span>
    <span class="c">// Make a function, disallow direct instantiation</span>
<span class="c"></span>    <span class="nx">YUI</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">Y</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

        <span class="c">// Allow instantiation without the new operator</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(!(</span><span class="nx">Y</span> <span class="k">instanceof</span> <span class="nx">YUI</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">new</span> <span class="nx">YUI</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="c">// set up the core environment</span>
<span class="c"></span>            <span class="nx">Y</span><span class="o">.</span><span class="nx">_init</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>

            <span class="c">// bind the specified additional modules for this instance</span>
<span class="c"></span>            <span class="nx">Y</span><span class="o">.</span><span class="nx">_setup</span><span class="o">();</span>

            <span class="k">return</span> <span class="nx">Y</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">};</span>
<span class="o">}</span>

<span class="c">// The prototype contains the functions that are required to allow the external</span>
<span class="c">// modules to be registered and for the instance to be initialized.</span>
<span class="c"></span><span class="nx">YUI</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>

    <span class="c">/**</span>
<span class="c">     * Initialize this YUI instance</span>
<span class="c">     * @param o config options</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_init</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">o</span> <span class="o">=</span> <span class="nx">o</span> <span class="o">||</span> <span class="o">{};</span>

        <span class="c">// find targeted window/frame</span>
<span class="c"></span>        <span class="c">// @TODO create facades</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">v</span> <span class="o">=</span> <span class="s1">&#39;@VERSION@&#39;</span><span class="o">,</span> <span class="nx">Y</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
        <span class="nx">o</span><span class="o">.</span><span class="nx">win</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">win</span> <span class="o">||</span> <span class="nb">window</span> <span class="o">||</span> <span class="o">{};</span>
        <span class="nx">o</span><span class="o">.</span><span class="nx">win</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">win</span><span class="o">.</span><span class="nx">contentWindow</span> <span class="o">||</span> <span class="nx">o</span><span class="o">.</span><span class="nx">win</span><span class="o">;</span>
        <span class="nx">o</span><span class="o">.</span><span class="nx">doc</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">win</span><span class="o">.</span><span class="nb">document</span><span class="o">;</span>
        <span class="nx">o</span><span class="o">.</span><span class="nx">debug</span> <span class="o">=</span> <span class="o">(</span><span class="s1">&#39;debug&#39;</span> <span class="k">in</span> <span class="nx">o</span><span class="o">)</span> <span class="o">?</span> <span class="nx">o</span><span class="o">.</span><span class="nx">debug</span> <span class="o">:</span> <span class="kc">true</span><span class="o">;</span>
        <span class="nx">o</span><span class="o">.</span><span class="nx">useBrowserConsole</span> <span class="o">=</span> <span class="o">(</span><span class="s1">&#39;useBrowserConsole&#39;</span> <span class="k">in</span> <span class="nx">o</span><span class="o">)</span> <span class="o">?</span> <span class="nx">o</span><span class="o">.</span><span class="nx">useBrowserConsole</span> <span class="o">:</span> <span class="kc">true</span><span class="o">;</span>
        <span class="nx">o</span><span class="o">.</span><span class="nx">throwFail</span> <span class="o">=</span> <span class="o">(</span><span class="s1">&#39;throwFail&#39;</span> <span class="k">in</span> <span class="nx">o</span><span class="o">)</span> <span class="o">?</span> <span class="nx">o</span><span class="o">.</span><span class="nx">throwFail</span> <span class="o">:</span> <span class="kc">true</span><span class="o">;</span>
    
        <span class="c">// add a reference to o for anything that needs it</span>
<span class="c"></span>        <span class="c">// before _setup is called.</span>
<span class="c"></span>        <span class="nx">Y</span><span class="o">.</span><span class="nx">config</span> <span class="o">=</span> <span class="nx">o</span><span class="o">;</span>

        <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span> <span class="o">=</span> <span class="o">{</span>
            <span class="c">// @todo expand the new module metadata</span>
<span class="c"></span>            <span class="nx">mods</span><span class="o">:</span> <span class="o">{},</span>
            <span class="nx">_idx</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>
            <span class="nx">_used</span><span class="o">:</span> <span class="o">{},</span>
            <span class="nx">_attached</span><span class="o">:</span> <span class="o">{},</span>
            <span class="nx">_yidx</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>
            <span class="nx">_uidx</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>
            <span class="nx">_loaded</span><span class="o">:</span> <span class="o">{}</span>
        <span class="o">};</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">v</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;@&#39;</span><span class="o">)</span> <span class="o">&gt;</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">v</span> <span class="o">=</span> <span class="s1">&#39;test&#39;</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="nx">Y</span><span class="o">.</span><span class="nx">version</span> <span class="o">=</span> <span class="nx">v</span><span class="o">;</span>

        <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_loaded</span><span class="o">[</span><span class="nx">v</span><span class="o">]</span> <span class="o">=</span> <span class="o">{};</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_yidx</span> <span class="o">=</span> <span class="o">(++</span><span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_yidx</span><span class="o">);</span>
            <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_guidp</span> <span class="o">=</span> <span class="o">(</span><span class="s1">&#39;yui_&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">version</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_yidx</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="nx">_startTime</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\./g</span><span class="o">,</span> <span class="s1">&#39;_&#39;</span><span class="o">);</span>
            <span class="nx">Y</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">stamp</span><span class="o">(</span><span class="nx">Y</span><span class="o">);</span>
            <span class="nx">_instances</span><span class="o">[</span><span class="nx">Y</span><span class="o">.</span><span class="nx">id</span><span class="o">]</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="nx">Y</span><span class="o">.</span><span class="nx">constructor</span> <span class="o">=</span> <span class="nx">YUI</span><span class="o">;</span>


        <span class="c">// this.log(this.id + &#39;) init &#39;);</span>
<span class="c"></span>    <span class="o">},</span>
    
    <span class="c">/**</span>
<span class="c">     * Finishes the instance setup. Attaches whatever modules were defined</span>
<span class="c">     * when the yui modules was registered.</span>
<span class="c">     * @method _setup</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_setup</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">use</span><span class="o">(</span><span class="s2">&quot;yui-base&quot;</span><span class="o">);</span>
        <span class="c">// @TODO eval the need to copy the config</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">config</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">merge</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">config</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Executes a method on a YUI instance with</span>
<span class="c">     * the specified id if the specified method is whitelisted.</span>
<span class="c">     * @method applyTo</span>
<span class="c">     * @param id {string} the YUI instance id</span>
<span class="c">     * @param method {string} the name of the method to exectute.</span>
<span class="c">     * Ex: &#39;Object.keys&#39;</span>
<span class="c">     * @param args {Array} the arguments to apply to the method</span>
<span class="c">     * @return {object} the return value from the applied method or null</span>
<span class="c">     */</span>
    <span class="nx">applyTo</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="nx">method</span><span class="o">,</span> <span class="nx">args</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(!(</span><span class="nx">method</span> <span class="k">in</span> <span class="nx">_APPLY_TO_WHITE_LIST</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">error</span><span class="o">(</span><span class="nx">method</span> <span class="o">+</span> <span class="s1">&#39;: applyTo not allowed&#39;</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">var</span> <span class="nx">instance</span> <span class="o">=</span> <span class="nx">_instances</span><span class="o">[</span><span class="nx">id</span><span class="o">],</span> <span class="nx">nest</span><span class="o">,</span> <span class="nx">m</span><span class="o">,</span> <span class="nx">i</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">instance</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">nest</span> <span class="o">=</span> <span class="nx">method</span><span class="o">.</span><span class="nx">split</span><span class="o">(</span><span class="s1">&#39;.&#39;</span><span class="o">);</span> 
            <span class="nx">m</span> <span class="o">=</span> <span class="nx">instance</span><span class="o">;</span>

            <span class="k">for</span> <span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nest</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>

                <span class="nx">m</span> <span class="o">=</span> <span class="nx">m</span><span class="o">[</span><span class="nx">nest</span><span class="o">[</span><span class="nx">i</span><span class="o">]];</span>

                <span class="k">if</span> <span class="o">(!</span><span class="nx">m</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">error</span><span class="o">(</span><span class="s1">&#39;applyTo not found: &#39;</span> <span class="o">+</span> <span class="nx">method</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">return</span> <span class="nx">m</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">instance</span><span class="o">,</span> <span class="nx">args</span><span class="o">);</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span> 

    <span class="c">/**</span>
<span class="c">     * Register a module</span>
<span class="c">     * @method add</span>
<span class="c">     * @param name {string} module name</span>
<span class="c">     * @param fn {Function} entry point into the module that</span>
<span class="c">     * is used to bind module to the YUI instance</span>
<span class="c">     * @param version {string} version string</span>
<span class="c">     * @param details optional config data: </span>
<span class="c">     * requires   - features that should be present before loading</span>
<span class="c">     * optional   - optional features that should be present if load optional defined</span>
<span class="c">     * use  - features that should be attached automatically</span>
<span class="c">     * skinnable  -</span>
<span class="c">     * rollup</span>
<span class="c">     * omit - features that should not be loaded if this module is present</span>
<span class="c">     * @return {YUI} the YUI instance</span>
<span class="c">     *</span>
<span class="c">     */</span>
    <span class="nx">add</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">name</span><span class="o">,</span> <span class="nx">fn</span><span class="o">,</span> <span class="nx">version</span><span class="o">,</span> <span class="nx">details</span><span class="o">)</span> <span class="o">{</span>

        <span class="c">// this.log(&#39;Adding a new component &#39; + name);</span>
<span class="c"></span>
        <span class="c">// @todo expand this to include version mapping</span>
<span class="c"></span>        
        <span class="c">// @todo allow requires/supersedes</span>
<span class="c"></span>
        <span class="c">// @todo may want to restore the build property</span>
<span class="c"></span>        
        <span class="c">// @todo fire moduleAvailable event</span>
<span class="c"></span>        
        <span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="o">{</span>
            <span class="nx">name</span><span class="o">:</span> <span class="nx">name</span><span class="o">,</span> 
            <span class="nx">fn</span><span class="o">:</span> <span class="nx">fn</span><span class="o">,</span>
            <span class="nx">version</span><span class="o">:</span> <span class="nx">version</span><span class="o">,</span>
            <span class="nx">details</span><span class="o">:</span> <span class="nx">details</span> <span class="o">||</span> <span class="o">{}</span>
        <span class="o">};</span>

        <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">mods</span><span class="o">[</span><span class="nx">name</span><span class="o">]</span> <span class="o">=</span> <span class="nx">m</span><span class="o">;</span>

        <span class="k">return</span> <span class="k">this</span><span class="o">;</span> <span class="c">// chain support</span>
<span class="c"></span>    <span class="o">},</span>

    <span class="nx">_attach</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">r</span><span class="o">,</span> <span class="nx">fromLoader</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">mods</span> <span class="o">=</span> <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">mods</span><span class="o">,</span>
            <span class="nx">attached</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_attached</span><span class="o">,</span>
            <span class="nx">i</span><span class="o">,</span> <span class="nx">l</span> <span class="o">=</span> <span class="nx">r</span><span class="o">.</span><span class="nx">length</span><span class="o">,</span> <span class="nx">name</span><span class="o">,</span> <span class="nx">m</span><span class="o">,</span> <span class="nx">d</span><span class="o">,</span> <span class="nx">req</span><span class="o">,</span> <span class="nx">use</span><span class="o">;</span>

        <span class="k">for</span> <span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">l</span><span class="o">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">name</span> <span class="o">=</span> <span class="nx">r</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span> 
            <span class="nx">m</span>    <span class="o">=</span> <span class="nx">mods</span><span class="o">[</span><span class="nx">name</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(!</span><span class="nx">attached</span><span class="o">[</span><span class="nx">name</span><span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="o">)</span> <span class="o">{</span>

                <span class="nx">attached</span><span class="o">[</span><span class="nx">name</span><span class="o">]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

                <span class="nx">d</span>   <span class="o">=</span> <span class="nx">m</span><span class="o">.</span><span class="nx">details</span><span class="o">;</span> 
                <span class="nx">req</span> <span class="o">=</span> <span class="nx">d</span><span class="o">.</span><span class="nx">requires</span><span class="o">;</span> 
                <span class="nx">use</span> <span class="o">=</span> <span class="nx">d</span><span class="o">.</span><span class="nx">use</span><span class="o">;</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">req</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_attach</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nb">Array</span><span class="o">(</span><span class="nx">req</span><span class="o">));</span>
                <span class="o">}</span>

                <span class="c">// this.log(&#39;attaching &#39; + name, &#39;info&#39;, &#39;yui&#39;);</span>
<span class="c"></span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">m</span><span class="o">.</span><span class="nx">fn</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">m</span><span class="o">.</span><span class="nx">fn</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">use</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_attach</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nb">Array</span><span class="o">(</span><span class="nx">use</span><span class="o">));</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>

    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Bind a module to a YUI instance</span>
<span class="c">     * @param modules* {string} 1-n modules to bind (uses arguments array)</span>
<span class="c">     * @param *callback {function} callback function executed when </span>
<span class="c">     * the instance has the required functionality.  If included, it</span>
<span class="c">     * must be the last parameter.</span>
<span class="c">     *</span>
<span class="c">     * @TODO </span>
<span class="c">     * Implement versioning?  loader can load different versions?</span>
<span class="c">     * Should sub-modules/plugins be normal modules, or do</span>
<span class="c">     * we add syntax for specifying these?</span>
<span class="c">     *</span>
<span class="c">     * YUI().use(&#39;dragdrop&#39;)</span>
<span class="c">     * YUI().use(&#39;dragdrop:2.4.0&#39;); // specific version</span>
<span class="c">     * YUI().use(&#39;dragdrop:2.4.0-&#39;); // at least this version</span>
<span class="c">     * YUI().use(&#39;dragdrop:2.4.0-2.9999.9999&#39;); // version range</span>
<span class="c">     * YUI().use(&#39;*&#39;); // use all available modules</span>
<span class="c">     * YUI().use(&#39;lang+dump+substitute&#39;); // use lang and some plugins</span>
<span class="c">     * YUI().use(&#39;lang+*&#39;); // use lang and all known plugins</span>
<span class="c">     *</span>
<span class="c">     *</span>
<span class="c">     * @return {YUI} the YUI instance</span>
<span class="c">     */</span>
    <span class="nx">use</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_loading</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_useQueue</span><span class="o">.</span><span class="nx">add</span><span class="o">(</span><span class="nx">SLICE</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">arguments</span><span class="o">,</span> <span class="m">0</span><span class="o">));</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">var</span> <span class="nx">Y</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span> 
            <span class="nx">a</span><span class="o">=</span><span class="nx">SLICE</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">arguments</span><span class="o">,</span> <span class="m">0</span><span class="o">),</span> 
            <span class="nx">mods</span> <span class="o">=</span> <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">mods</span><span class="o">,</span> 
            <span class="nx">used</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_used</span><span class="o">,</span>
            <span class="nx">loader</span><span class="o">,</span> 
            <span class="nx">firstArg</span> <span class="o">=</span> <span class="nx">a</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> 
            <span class="nx">dynamic</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
            <span class="nx">callback</span> <span class="o">=</span> <span class="nx">a</span><span class="o">[</span><span class="nx">a</span><span class="o">.</span><span class="nx">length</span><span class="o">-</span><span class="m">1</span><span class="o">],</span>
            <span class="nx">k</span><span class="o">,</span> <span class="nx">i</span><span class="o">,</span> <span class="nx">l</span><span class="o">,</span> <span class="nx">missing</span> <span class="o">=</span> <span class="o">[],</span> 
            <span class="nx">r</span> <span class="o">=</span> <span class="o">[],</span> 
            <span class="nx">f</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">name</span><span class="o">)</span> <span class="o">{</span>

                <span class="c">// only attach a module once</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">used</span><span class="o">[</span><span class="nx">name</span><span class="o">])</span> <span class="o">{</span>
                    <span class="c">// Y.log(name + &#39; already used&#39;, &#39;info&#39;, &#39;yui&#39;);</span>
<span class="c"></span>                    <span class="k">return</span><span class="o">;</span>
                <span class="o">}</span>

                <span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">mods</span><span class="o">[</span><span class="nx">name</span><span class="o">],</span> <span class="nx">j</span><span class="o">,</span> <span class="nx">req</span><span class="o">,</span> <span class="nx">use</span><span class="o">;</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">m</span><span class="o">)</span> <span class="o">{</span>

                    <span class="c">// Y.log(&#39;USING &#39; + name, &#39;info&#39;, &#39;yui&#39;);</span>
<span class="c"></span>
                    <span class="nx">used</span><span class="o">[</span><span class="nx">name</span><span class="o">]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

                    <span class="nx">req</span> <span class="o">=</span> <span class="nx">m</span><span class="o">.</span><span class="nx">details</span><span class="o">.</span><span class="nx">requires</span><span class="o">;</span>
                    <span class="nx">use</span> <span class="o">=</span> <span class="nx">m</span><span class="o">.</span><span class="nx">details</span><span class="o">.</span><span class="nx">use</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>

                    <span class="c">// CSS files don&#39;t register themselves, see if it has been loaded</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">(!</span><span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_loaded</span><span class="o">[</span><span class="nx">Y</span><span class="o">.</span><span class="nx">version</span><span class="o">][</span><span class="nx">name</span><span class="o">])</span> <span class="o">{</span>
                        <span class="nx">Y</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;module not found: &#39;</span> <span class="o">+</span> <span class="nx">name</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;yui&#39;</span><span class="o">);</span>
                        <span class="nx">missing</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">name</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="c">// probably css</span>
<span class="c"></span>                        <span class="c">// Y.log(&#39;module not found BUT HAS BEEN LOADED: &#39; + name, &#39;info&#39;, &#39;yui&#39;);</span>
<span class="c"></span>                        <span class="nx">used</span><span class="o">[</span><span class="nx">name</span><span class="o">]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>

                <span class="c">// make sure requirements are attached</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">req</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">req</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">f</span><span class="o">(</span><span class="nx">req</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">for</span> <span class="o">(</span><span class="nx">j</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">req</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span> <span class="o">=</span> <span class="nx">j</span> <span class="o">+</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                            <span class="c">// Y.log(&#39;using module\&#39;s requirements: &#39; + name, &#39;info&#39;, &#39;yui&#39;);</span>
<span class="c"></span>                            <span class="nx">f</span><span class="o">(</span><span class="nx">req</span><span class="o">[</span><span class="nx">j</span><span class="o">]);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>

                <span class="c">// add this module to full list of things to attach</span>
<span class="c"></span>                <span class="c">// Y.log(&#39;adding to requires list: &#39; + name);</span>
<span class="c"></span>                <span class="nx">r</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">name</span><span class="o">);</span>

            <span class="o">},</span>

            <span class="nx">onComplete</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">fromLoader</span><span class="o">)</span> <span class="o">{</span>

                <span class="c">// Y.log(&#39;Use complete&#39;);</span>
<span class="c"></span>
                <span class="nx">fromLoader</span> <span class="o">=</span> <span class="nx">fromLoader</span> <span class="o">||</span> <span class="o">{</span>
                    <span class="nx">success</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                    <span class="nx">msg</span><span class="o">:</span> <span class="s1">&#39;not dynamic&#39;</span>
                <span class="o">};</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_callback</span><span class="o">)</span> <span class="o">{</span>

                    <span class="k">var</span> <span class="nx">cb</span> <span class="o">=</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_callback</span><span class="o">;</span>
                    <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_callback</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="nx">cb</span><span class="o">(</span><span class="nx">Y</span><span class="o">,</span> <span class="nx">fromLoader</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">fire</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">Y</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="s1">&#39;yui:load&#39;</span><span class="o">,</span> <span class="nx">Y</span><span class="o">,</span> <span class="nx">fromLoader</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="c">// process queued use requests as long until done </span>
<span class="c"></span>                <span class="c">// or dynamic load happens again.</span>
<span class="c"></span>                <span class="k">this</span><span class="o">.</span><span class="nx">_loading</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="k">while</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_useQueue</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_useQueue</span><span class="o">.</span><span class="nx">size</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_loading</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">Y</span><span class="o">.</span><span class="nx">use</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">Y</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_useQueue</span><span class="o">.</span><span class="nx">next</span><span class="o">());</span>
                <span class="o">}</span>
            <span class="o">};</span>

        <span class="c">// Y.log(Y.id + &#39;: use called: &#39; + a + &#39; :: &#39; + callback);</span>
<span class="c"></span>
        <span class="c">// The last argument supplied to use can be a load complete callback</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">callback</span> <span class="o">===</span> <span class="s1">&#39;function&#39;</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">a</span><span class="o">.</span><span class="nx">pop</span><span class="o">();</span>
            <span class="nx">Y</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_callback</span> <span class="o">=</span> <span class="nx">callback</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="nx">callback</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="c">// YUI().use(&#39;*&#39;); // bind everything available</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">firstArg</span> <span class="o">===</span> <span class="s2">&quot;*&quot;</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">a</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="k">for</span> <span class="o">(</span><span class="nx">k</span> <span class="k">in</span> <span class="nx">mods</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">mods</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">k</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">a</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">k</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="c">// Y.log(&#39;Use *: &#39; + a);</span>
<span class="c"></span>
            <span class="k">return</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">use</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">Y</span><span class="o">,</span> <span class="nx">a</span><span class="o">);</span>

        <span class="o">}</span>
        
        <span class="c">// Y.log(&#39;loader before: &#39; + a.join(&#39;,&#39;));</span>
<span class="c"></span>
        <span class="c">// use loader to expand dependencies and sort the </span>
<span class="c"></span>        <span class="c">// requirements if it is available.</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">Loader</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">dynamic</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_useQueue</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_useQueue</span> <span class="o">||</span> <span class="k">new</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Queue</span><span class="o">();</span>
            <span class="nx">loader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Loader</span><span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">config</span><span class="o">);</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">require</span><span class="o">(</span><span class="nx">a</span><span class="o">);</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">ignoreRegistered</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">allowRollup</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">calculate</span><span class="o">();</span>
            <span class="nx">a</span> <span class="o">=</span> <span class="nx">loader</span><span class="o">.</span><span class="nx">sorted</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="c">// Y.log(&#39;loader after: &#39; + a.join(&#39;,&#39;));</span>
<span class="c"></span>
        <span class="nx">l</span> <span class="o">=</span> <span class="nx">a</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>

        <span class="c">// process each requirement and any additional requirements </span>
<span class="c"></span>        <span class="c">// the module metadata specifies</span>
<span class="c"></span>        <span class="k">for</span> <span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">l</span><span class="o">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">f</span><span class="o">(</span><span class="nx">a</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
        <span class="o">}</span>

        <span class="c">// Y.log(&#39;all reqs: &#39; + r + &#39; --- missing: &#39; + missing + &#39;, l: &#39; + l + &#39;, &#39; + r[0]);</span>
<span class="c"></span>
        <span class="c">// dynamic load</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">Loader</span> <span class="o">&amp;&amp;</span> <span class="nx">missing</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">Y</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Attempting to dynamically load the missing modules &#39;</span> <span class="o">+</span> <span class="nx">missing</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;yui&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_loading</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="nx">loader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Loader</span><span class="o">(</span><span class="nx">Y</span><span class="o">.</span><span class="nx">config</span><span class="o">);</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">onSuccess</span> <span class="o">=</span> <span class="nx">onComplete</span><span class="o">;</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">onFailure</span> <span class="o">=</span> <span class="nx">onComplete</span><span class="o">;</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">onTimeout</span> <span class="o">=</span> <span class="nx">onComplete</span><span class="o">;</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">attaching</span> <span class="o">=</span> <span class="nx">a</span><span class="o">;</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">require</span><span class="o">(</span><span class="nx">missing</span><span class="o">);</span>
            <span class="nx">loader</span><span class="o">.</span><span class="nx">insert</span><span class="o">();</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="nx">Y</span><span class="o">.</span><span class="nx">_attach</span><span class="o">(</span><span class="nx">r</span><span class="o">);</span>
            <span class="nx">onComplete</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="nx">Y</span><span class="o">;</span> <span class="c">// chain support var yui = YUI().use(&#39;dragdrop&#39;);</span>
<span class="c"></span>    <span class="o">},</span>


    <span class="c">/**</span>
<span class="c">     * Returns the namespace specified and creates it if it doesn&#39;t exist</span>
<span class="c">     * &lt;pre&gt;</span>
<span class="c">     * YUI.namespace(&quot;property.package&quot;);</span>
<span class="c">     * YUI.namespace(&quot;YAHOO.property.package&quot;);</span>
<span class="c">     * &lt;/pre&gt;</span>
<span class="c">     * Either of the above would create YUI.property, then</span>
<span class="c">     * YUI.property.package (YAHOO is scrubbed out, this is</span>
<span class="c">     * to remain compatible with YUI2)</span>
<span class="c">     *</span>
<span class="c">     * Be careful when naming packages. Reserved words may work in some browsers</span>
<span class="c">     * and not others. For instance, the following will fail in Safari:</span>
<span class="c">     * &lt;pre&gt;</span>
<span class="c">     * YUI.namespace(&quot;really.long.nested.namespace&quot;);</span>
<span class="c">     * &lt;/pre&gt;</span>
<span class="c">     * This fails because &quot;long&quot; is a future reserved word in ECMAScript</span>
<span class="c">     *</span>
<span class="c">     * @method namespace</span>
<span class="c">     * @param  {string*} arguments 1-n namespaces to create </span>
<span class="c">     * @return {object}  A reference to the last namespace object created</span>
<span class="c">     */</span>
    <span class="nx">namespace</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">a</span><span class="o">=</span><span class="nx">arguments</span><span class="o">,</span> <span class="nx">o</span><span class="o">=</span><span class="kc">null</span><span class="o">,</span> <span class="nx">i</span><span class="o">,</span> <span class="nx">j</span><span class="o">,</span> <span class="nx">d</span><span class="o">;</span>
        <span class="k">for</span> <span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">a</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">d</span> <span class="o">=</span> <span class="o">(</span><span class="s2">&quot;&quot;</span> <span class="o">+</span> <span class="nx">a</span><span class="o">[</span><span class="nx">i</span><span class="o">]).</span><span class="nx">split</span><span class="o">(</span><span class="s2">&quot;.&quot;</span><span class="o">);</span>
            <span class="nx">o</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="nx">j</span><span class="o">=(</span><span class="nx">d</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">==</span> <span class="s2">&quot;YAHOO&quot;</span><span class="o">)</span> <span class="o">?</span> <span class="m">1</span> <span class="o">:</span> <span class="m">0</span><span class="o">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">d</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">o</span><span class="o">[</span><span class="nx">d</span><span class="o">[</span><span class="nx">j</span><span class="o">]]</span> <span class="o">=</span> <span class="nx">o</span><span class="o">[</span><span class="nx">d</span><span class="o">[</span><span class="nx">j</span><span class="o">]]</span> <span class="o">||</span> <span class="o">{};</span>
                <span class="nx">o</span> <span class="o">=</span> <span class="nx">o</span><span class="o">[</span><span class="nx">d</span><span class="o">[</span><span class="nx">j</span><span class="o">]];</span>
            <span class="o">}</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="nx">o</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">// this is replaced if the log module is included</span>
<span class="c"></span>    <span class="nx">log</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Report an error.  The reporting mechanism is controled by</span>
<span class="c">     * the &#39;throwFail&#39; configuration attribute.  If throwFail is</span>
<span class="c">     * not specified, the message is written to the Logger, otherwise</span>
<span class="c">     * a JS error is thrown</span>
<span class="c">     * @method error</span>
<span class="c">     * @param msg {string} the error message</span>
<span class="c">     * @param e {Error} Optional JS error that was caught.  If supplied</span>
<span class="c">     * and throwFail is specified, this error will be re-thrown.</span>
<span class="c">     * @return {YUI} this YUI instance</span>
<span class="c">     */</span>
    <span class="nx">error</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">msg</span><span class="o">,</span> <span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">config</span><span class="o">.</span><span class="nx">throwFail</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">throw</span> <span class="o">(</span><span class="nx">e</span> <span class="o">||</span> <span class="k">new</span> <span class="nb">Error</span><span class="o">(</span><span class="nx">msg</span><span class="o">));</span> 
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">message</span><span class="o">(</span><span class="nx">msg</span><span class="o">,</span> <span class="s2">&quot;error&quot;</span><span class="o">);</span> <span class="c">// don&#39;t scrub this one</span>
<span class="c"></span>        <span class="o">}</span>

        <span class="k">return</span> <span class="k">this</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Generate an id that is unique among all YUI instances</span>
<span class="c">     * @method guid</span>
<span class="c">     * @param pre {string} optional guid prefix</span>
<span class="c">     * @return {string} the guid</span>
<span class="c">     */</span>
    <span class="nx">guid</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">pre</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">id</span> <span class="o">=</span>  <span class="k">this</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_guidp</span> <span class="o">+</span> <span class="o">(++</span><span class="k">this</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">_uidx</span><span class="o">);</span>
        <span class="k">return</span> <span class="o">(</span><span class="nx">pre</span><span class="o">)</span> <span class="o">?</span> <span class="o">(</span><span class="nx">pre</span> <span class="o">+</span> <span class="nx">id</span><span class="o">)</span> <span class="o">:</span> <span class="nx">id</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns a guid associated with an object.  If the object</span>
<span class="c">     * does not have one, a new one is created unless readOnly</span>
<span class="c">     * is specified.</span>
<span class="c">     * @method stamp</span>
<span class="c">     * @param o The object to stamp</span>
<span class="c">     * @param readOnly {boolean} if true, a valid guid will only</span>
<span class="c">     * be returned if the object has one assigned to it.</span>
<span class="c">     * @return {string} The object&#39;s guid or null</span>
<span class="c">     */</span>
    <span class="nx">stamp</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">,</span> <span class="nx">readOnly</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="nx">o</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">var</span> <span class="nx">uid</span> <span class="o">=</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">o</span> <span class="o">===</span> <span class="s1">&#39;string&#39;</span><span class="o">)</span> <span class="o">?</span> <span class="nx">o</span> <span class="o">:</span> <span class="nx">o</span><span class="o">.</span><span class="nx">_yuid</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">uid</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">uid</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">guid</span><span class="o">();</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">readOnly</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">try</span> <span class="o">{</span>
                    <span class="nx">o</span><span class="o">.</span><span class="nx">_yuid</span> <span class="o">=</span> <span class="nx">uid</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">catch</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">uid</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="nx">uid</span><span class="o">;</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="c">// Give the YUI global the same properties as an instance.</span>
<span class="c">// This makes it so that the YUI global can be used like the YAHOO</span>
<span class="c">// global was used prior to 3.x.  More importantly, the YUI global</span>
<span class="c">// provides global metadata, so env needs to be configured.</span>
<span class="c">// @TODO review</span>
<span class="c"></span>
    <span class="nx">p</span> <span class="o">=</span> <span class="nx">YUI</span><span class="o">.</span><span class="nx">prototype</span><span class="o">;</span>

    <span class="c">// inheritance utilities are not available yet</span>
<span class="c"></span>    <span class="k">for</span> <span class="o">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">p</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YUI</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">p</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="c">// set up the environment</span>
<span class="c"></span>    <span class="nx">YUI</span><span class="o">.</span><span class="nx">_init</span><span class="o">();</span>

    <span class="c">// add a window load event at load time so we can capture</span>
<span class="c"></span>    <span class="c">// the case where it fires before dynamic loading is</span>
<span class="c"></span>    <span class="c">// complete.</span>
<span class="c"></span>    <span class="nx">add</span><span class="o">(</span><span class="nb">window</span><span class="o">,</span> <span class="s1">&#39;load&#39;</span><span class="o">,</span> <span class="nx">globalListener</span><span class="o">);</span>

    <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">add</span> <span class="o">=</span> <span class="nx">add</span><span class="o">;</span>
    <span class="nx">YUI</span><span class="o">.</span><span class="nx">Env</span><span class="o">.</span><span class="nx">remove</span> <span class="o">=</span> <span class="nx">remove</span><span class="o">;</span>

    <span class="c">/*</span>
<span class="c">     * Subscribe to an event.  The signature differs depending on the</span>
<span class="c">     * type of event you are attaching to.</span>
<span class="c">     * @method on </span>
<span class="c">     * @param type {string|function|object} The type of the event.  If</span>
<span class="c">     * this is a function, this is dispatched to the aop system.  If an</span>
<span class="c">     * object, it is parsed for multiple subsription definitions</span>
<span class="c">     * @param fn {Function} The callback</span>
<span class="c">     * @param elspec {any} DOM element(s), selector string(s), and or</span>
<span class="c">     * Node ref(s) to attach DOM related events to (only applies to</span>
<span class="c">     * DOM events).</span>
<span class="c">     * @param</span>
<span class="c">     * @return the event target or a detach handle per &#39;chain&#39; config</span>
<span class="c">     */</span>

<span class="o">})();</span>

<span class="c">/**</span>
<span class="c"> * The config object contains all of the configuration options for</span>
<span class="c"> * the YUI instance.  This object is supplied by the implementer </span>
<span class="c"> * when instantiating a YUI instance.  Some properties have default</span>
<span class="c"> * values if they are not supplied by the implementer.</span>
<span class="c"> * @class config</span>
<span class="c"> * @static</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Turn debug statements on or off</span>
<span class="c"> * @property debug</span>
<span class="c"> * @type boolean</span>
<span class="c"> * @default true</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Log to the browser console if debug is on and the browser has a</span>
<span class="c"> * supported console</span>
<span class="c"> * @property useBrowserConsole</span>
<span class="c"> * @type boolean</span>
<span class="c"> * @default true</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A hash of log sources that should be logged.  If specified, only log messages from these sources will be logged.</span>
<span class="c"> * @property logInclude</span>
<span class="c"> * @type object</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A hash of log sources that should be not be logged.  If specified, all sources are logged if not on this list.&lt;/li&gt;</span>
<span class="c"> * @property logExclude</span>
<span class="c"> * @type object</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Set to true if the yui seed file was dynamically loaded in </span>
<span class="c"> * order to bootstrap components relying on the window load event </span>
<span class="c"> * and onDOMReady.</span>
<span class="c"> * @property injected</span>
<span class="c"> * @type object</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * If throwFail is set, Y.fail will generate or re-throw a JS Error.  Otherwise the failure is logged.</span>
<span class="c"> * @property throwFail</span>
<span class="c"> * @type boolean</span>
<span class="c"> * @default true</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The window/frame that this instance should operate in</span>
<span class="c"> * @property win</span>
<span class="c"> * @type Window</span>
<span class="c"> * @default the window hosting YUI</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The document associated with the &#39;win&#39; configuration</span>
<span class="c"> * @property doc</span>
<span class="c"> * @type Document</span>
<span class="c"> * @default the document hosting YUI</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A list of modules that defines the YUI core (overrides the default)&lt;/li&gt;</span>
<span class="c"> * @property core</span>
<span class="c"> * @type string[]</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The default date format</span>
<span class="c"> * @property dateFormat</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The default locale</span>
<span class="c"> * @property locale</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The default interval when polling in milliseconds.</span>
<span class="c"> * @property pollInterval</span>
<span class="c"> * @type int</span>
<span class="c"> * @default 20</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The number of dynamic nodes to insert by default before</span>
<span class="c"> * automatically removing them.  This applies to script nodes</span>
<span class="c"> * because remove the node will not make the evaluated script</span>
<span class="c"> * unavailable.  Dynamic CSS is not auto purged, because removing</span>
<span class="c"> * a linked style sheet will also remove the style definitions.</span>
<span class="c"> * @property purgethreshold</span>
<span class="c"> * @type int</span>
<span class="c"> * @default 20</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The default interval when polling in milliseconds.</span>
<span class="c"> * @property windowResizeDelay</span>
<span class="c"> * @type int</span>
<span class="c"> * @default 40</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Base directory for dynamic loading</span>
<span class="c"> * @property base</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The secure base dir (not implemented)</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property secureBase</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property comboBase</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * The root path to prepend to module names for the combo service. Ex: 3.0.0b1/build/</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property root</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A filter to apply to result urls.  This filter will modify the default</span>
<span class="c"> * path for all modules.  The default path for the YUI library is the</span>
<span class="c"> * minified version of the files (e.g., event-min.js).  The filter property</span>
<span class="c"> * can be a predefined filter or a custom filter.  The valid predefined </span>
<span class="c"> * filters are:</span>
<span class="c"> * &lt;dl&gt;</span>
<span class="c"> *  &lt;dt&gt;DEBUG&lt;/dt&gt;</span>
<span class="c"> *  &lt;dd&gt;Selects the debug versions of the library (e.g., event-debug.js).</span>
<span class="c"> *      This option will automatically include the Logger widget&lt;/dd&gt;</span>
<span class="c"> *  &lt;dt&gt;RAW&lt;/dt&gt;</span>
<span class="c"> *  &lt;dd&gt;Selects the non-minified version of the library (e.g., event.js).&lt;/dd&gt;</span>
<span class="c"> * &lt;/dl&gt;</span>
<span class="c"> * You can also define a custom filter, which must be an object literal </span>
<span class="c"> * containing a search expression and a replace string:</span>
<span class="c"> * &lt;pre&gt;</span>
<span class="c"> *  myFilter: &amp;#123; </span>
<span class="c"> *      &#39;searchExp&#39;: &quot;-min\\.js&quot;, </span>
<span class="c"> *      &#39;replaceStr&#39;: &quot;-debug.js&quot;</span>
<span class="c"> *  &amp;#125;</span>
<span class="c"> * &lt;/pre&gt;</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property filter</span>
<span class="c"> * @type string|object</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Hash of per-component filter specification.  If specified for a given component, </span>
<span class="c"> * this overrides the filter config</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property filters</span>
<span class="c"> * @type object</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Use the YUI combo service to reduce the number of http connections </span>
<span class="c"> * required to load your dependencies</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property combine</span>
<span class="c"> * @type boolean</span>
<span class="c"> * @default true if &#39;base&#39; is not supplied, false if it is.</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A list of modules that should never be dynamically loaded</span>
<span class="c"> * @property ignore</span>
<span class="c"> * @type string[]</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A list of modules that should always be loaded when required, even if already </span>
<span class="c"> * present on the page.</span>
<span class="c"> * @property force</span>
<span class="c"> * @type string[]</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Node or id for a node that should be used as the insertion point for new nodes</span>
<span class="c"> * For dynamic loading.</span>
<span class="c"> * @property insertBefore</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * charset for dynamic nodes</span>
<span class="c"> * @property charset</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Object literal containing attributes to add to dynamically loaded script nodes.</span>
<span class="c"> * @property jsAttributes</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Object literal containing attributes to add to dynamically loaded link nodes.</span>
<span class="c"> * @property cssAttributes</span>
<span class="c"> * @type string</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Number of milliseconds before a timeout occurs when dynamically </span>
<span class="c"> * loading nodes. If not set, there is no timeout.</span>
<span class="c"> * @property timeout</span>
<span class="c"> * @type int</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Callback for the &#39;CSSComplete&#39; event.  When dynamically loading YUI </span>
<span class="c"> * components with CSS, this property fires when the CSS is finished</span>
<span class="c"> * loading but script loading is still ongoing.  This provides an</span>
<span class="c"> * opportunity to enhance the presentation of a loading page a little</span>
<span class="c"> * bit before the entire loading process is done.</span>
<span class="c"> * @property onCSS</span>
<span class="c"> * @type function</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * A list of module definitions to add to the list of YUI components.  </span>
<span class="c"> * These components can then be dynamically loaded side by side with</span>
<span class="c"> * YUI via the use() method.See Loader.addModule for the supported</span>
<span class="c"> * module metadata.</span>
<span class="c"> * @property modules</span>
<span class="c"> * @type function</span>
<span class="c"> */</span>
 
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_anim.html" title="anim">anim</a></li>
                                <li class=""><a href="module_attribute.html" title="attribute">attribute</a></li>
                                <li class=""><a href="module_base.html" title="base">base</a></li>
                                <li class=""><a href="module_cache.html" title="cache">cache</a></li>
                                <li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
                                <li class=""><a href="module_collection.html" title="collection">collection</a></li>
                                <li class=""><a href="module_console.html" title="console">console</a></li>
                                <li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatype.html" title="datatype">datatype</a></li>
                                <li class=""><a href="module_dd.html" title="dd">dd</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dump.html" title="dump">dump</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_io.html" title="io">io</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_node.html" title="node">node</a></li>
                                <li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
                                <li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li>
                                <li class=""><a href="module_oop.html" title="oop">oop</a></li>
                                <li class=""><a href="module_overlay.html" title="overlay">overlay</a></li>
                                <li class=""><a href="module_plugin.html" title="plugin">plugin</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_queue.html" title="queue">queue</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_substitute.html" title="substitute">substitute</a></li>
                                <li class=""><a href="module_test.html" title="test">test</a></li>
                                <li class=""><a href="module_widget.html" title="widget">widget</a></li>
                                <li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li>
                                <li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li>
                                <li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li>
                                <li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li>
                                <li class="selected"><a href="module_yui.html" title="yui">yui</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="Array.html" title="Array">Array</a></li>
                                <li class=""><a href="config.html" title="config">config</a></li>
                                <li class=""><a href="Get.html" title="Get">Get</a></li>
                                <li class=""><a href="Lang.html" title="Lang">Lang</a></li>
                                <li class=""><a href="Loader.html" title="Loader">Loader</a></li>
                                <li class=""><a href="Object.html" title="Object">Object</a></li>
                                <li class=""><a href="UA.html" title="UA">UA</a></li>
                                <li class=""><a href="YUI.html" title="YUI">YUI</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="_module.js.html" title="_module.js">_module.js</a></li>
                                <li class=""><a href="get.js.html" title="get.js">get.js</a></li>
                                <li class=""><a href="loader.js.html" title="loader.js">loader.js</a></li>
                                <li class=""><a href="yui-array.js.html" title="yui-array.js">yui-array.js</a></li>
                                <li class=""><a href="yui-base.js.html" title="yui-base.js">yui-base.js</a></li>
                                <li class=""><a href="yui-core.js.html" title="yui-core.js">yui-core.js</a></li>
                                <li class=""><a href="yui-init.js.html" title="yui-init.js">yui-init.js</a></li>
                                <li class=""><a href="yui-lang.js.html" title="yui-lang.js">yui-lang.js</a></li>
                                <li class=""><a href="yui-later.js.html" title="yui-later.js">yui-later.js</a></li>
                                <li class=""><a href="yui-log.js.html" title="yui-log.js">yui-log.js</a></li>
                                <li class=""><a href="yui-object.js.html" title="yui-object.js">yui-object.js</a></li>
                                <li class=""><a href="yui-ua.js.html" title="yui-ua.js">yui-ua.js</a></li>
                                <li class="selected"><a href="yui.js.html" title="yui.js">yui.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2009 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "", "host": "Object", "name": "()", "url": "Object.html#method_()", "type": "method"}, {"access": "", "host": "Array", "name": "()", "url": "Array.html#method_()", "type": "method"}, {"access": "", "host": "Get", "name": "abort", "url": "Get.html#method_abort", "type": "method"}, {"access": "", "host": "YUI", "name": "add", "url": "YUI.html#method_add", "type": "method"}, {"access": "", "host": "Loader", "name": "addModule", "url": "Loader.html#method_addModule", "type": "method"}, {"access": "private", "host": "Loader", "name": "_addSkin", "url": "Loader.html#method__addSkin", "type": "method"}, {"access": "", "host": "UA", "name": "air", "url": "UA.html#property_air", "type": "property"}, {"access": "", "host": "Loader", "name": "allowRollup", "url": "Loader.html#property_allowRollup", "type": "property"}, {"access": "", "host": "YUI", "name": "applyTo", "url": "YUI.html#method_applyTo", "type": "method"}, {"access": "", "host": "Loader", "name": "attaching", "url": "Loader.html#property_attaching", "type": "property"}, {"access": "private", "host": "Get", "name": "_autoPurge", "url": "Get.html#method__autoPurge", "type": "method"}, {"access": "", "host": "YUI", "name": "available", "url": "YUI.html#event_available", "type": "event"}, {"access": "", "host": "config", "name": "base", "url": "config.html#property_base", "type": "property"}, {"access": "", "host": "Loader", "name": "base", "url": "Loader.html#property_base", "type": "property"}, {"access": "", "host": "YUI", "name": "blur", "url": "YUI.html#event_blur", "type": "event"}, {"access": "", "host": "YUI", "name": "cached", "url": "YUI.html#method_cached", "type": "method"}, {"access": "", "host": "UA", "name": "caja", "url": "UA.html#property_caja", "type": "property"}, {"access": "", "host": "Loader", "name": "calculate", "url": "Loader.html#method_calculate", "type": "method"}, {"access": "", "host": "config", "name": "charset", "url": "config.html#property_charset", "type": "property"}, {"access": "", "host": "Loader", "name": "charset", "url": "Loader.html#property_charset", "type": "property"}, {"access": "", "host": "config", "name": "combine", "url": "config.html#property_combine", "type": "property"}, {"access": "", "host": "Loader", "name": "combine", "url": "Loader.html#property_combine", "type": "property"}, {"access": "", "host": "config", "name": "comboBase", "url": "config.html#property_comboBase", "type": "property"}, {"access": "", "host": "Loader", "name": "comboBase", "url": "Loader.html#property_comboBase", "type": "property"}, {"access": "", "host": "YUI", "name": "contentready", "url": "YUI.html#event_contentready", "type": "event"}, {"access": "", "host": "Loader", "name": "context", "url": "Loader.html#property_context", "type": "property"}, {"access": "", "host": "config", "name": "core", "url": "config.html#property_core", "type": "property"}, {"access": "", "host": "Get", "name": "css", "url": "Get.html#method_css", "type": "method"}, {"access": "", "host": "config", "name": "cssAttributes", "url": "config.html#property_cssAttributes", "type": "property"}, {"access": "", "host": "Loader", "name": "cssAttributes", "url": "Loader.html#property_cssAttributes", "type": "property"}, {"access": "", "host": "Loader", "name": "data", "url": "Loader.html#property_data", "type": "property"}, {"access": "", "host": "config", "name": "dateFormat", "url": "config.html#property_dateFormat", "type": "property"}, {"access": "", "host": "config", "name": "debug", "url": "config.html#property_debug", "type": "property"}, {"access": "", "host": "YUI", "name": "delegate", "url": "YUI.html#event_delegate", "type": "event"}, {"access": "", "host": "Loader", "name": "dirty", "url": "Loader.html#property_dirty", "type": "property"}, {"access": "", "host": "config", "name": "doc", "url": "config.html#property_doc", "type": "property"}, {"access": "", "host": "YUI", "name": "domready", "url": "YUI.html#event_domready", "type": "event"}, {"access": "", "host": "Object", "name": "each", "url": "Object.html#method_each", "type": "method"}, {"access": "", "host": "Array", "name": "each", "url": "Array.html#method_each", "type": "method"}, {"access": "private", "host": "Get", "name": "_end", "url": "Get.html#method__end", "type": "method"}, {"access": "", "host": "YUI", "name": "error", "url": "YUI.html#method_error", "type": "method"}, {"access": "", "host": "YUI", "name": "event:ready", "url": "YUI.html#event_event:ready", "type": "event"}, {"access": "private", "host": "Loader", "name": "_explode", "url": "Loader.html#method__explode", "type": "method"}, {"access": "private", "host": "Object", "name": "_extract", "url": "Object.html#method__extract", "type": "method"}, {"access": "", "host": "config", "name": "filter", "url": "config.html#property_filter", "type": "property"}, {"access": "", "host": "Loader", "name": "filter", "url": "Loader.html#property_filter", "type": "property"}, {"access": "private", "host": "Loader", "name": "_filter", "url": "Loader.html#method__filter", "type": "method"}, {"access": "", "host": "config", "name": "filters", "url": "config.html#property_filters", "type": "property"}, {"access": "", "host": "Loader", "name": "filters", "url": "Loader.html#property_filters", "type": "property"}, {"access": "private", "host": "Get", "name": "_finalize", "url": "Get.html#method__finalize", "type": "method"}, {"access": "private", "host": "Get", "name": "_finish", "url": "Get.html#method__finish", "type": "method"}, {"access": "", "host": "YUI", "name": "focus", "url": "YUI.html#event_focus", "type": "event"}, {"access": "", "host": "config", "name": "force", "url": "config.html#property_force", "type": "property"}, {"access": "", "host": "Loader", "name": "force", "url": "Loader.html#property_force", "type": "property"}, {"access": "", "host": "Loader", "name": "formatSkin", "url": "Loader.html#method_formatSkin", "type": "method"}, {"access": "", "host": "UA", "name": "gecko", "url": "UA.html#property_gecko", "type": "property"}, {"access": "", "host": "Loader", "name": "getProvides", "url": "Loader.html#method_getProvides", "type": "method"}, {"access": "", "host": "Loader", "name": "getRequires", "url": "Loader.html#method_getRequires", "type": "method"}, {"access": "", "host": "Object", "name": "getValue", "url": "Object.html#method_getValue", "type": "method"}, {"access": "", "host": "YUI", "name": "Global", "url": "YUI.html#property_Global", "type": "property"}, {"access": "", "host": "YUI", "name": "guid", "url": "YUI.html#method_guid", "type": "method"}, {"access": "", "host": "Array", "name": "hash", "url": "Array.html#method_hash", "type": "method"}, {"access": "", "host": "Object", "name": "hasKey", "url": "Object.html#method_hasKey", "type": "method"}, {"access": "", "host": "Object", "name": "hasValue", "url": "Object.html#method_hasValue", "type": "method"}, {"access": "", "host": "UA", "name": "ie", "url": "UA.html#property_ie", "type": "property"}, {"access": "", "host": "config", "name": "ignore", "url": "config.html#property_ignore", "type": "property"}, {"access": "", "host": "Loader", "name": "ignore", "url": "Loader.html#property_ignore", "type": "property"}, {"access": "", "host": "Loader", "name": "ignoreRegistered", "url": "Loader.html#property_ignoreRegistered", "type": "property"}, {"access": "", "host": "Array", "name": "indexOf", "url": "Array.html#method_indexOf", "type": "method"}, {"access": "private", "host": "YUI", "name": "_init", "url": "YUI.html#method__init", "type": "method"}, {"access": "", "host": "config", "name": "injected", "url": "config.html#property_injected", "type": "property"}, {"access": "", "host": "Loader", "name": "insert", "url": "Loader.html#method_insert", "type": "method"}, {"access": "", "host": "config", "name": "insertBefore", "url": "config.html#property_insertBefore", "type": "property"}, {"access": "", "host": "Loader", "name": "insertBefore", "url": "Loader.html#property_insertBefore", "type": "property"}, {"access": "", "host": "Loader", "name": "inserted", "url": "Loader.html#property_inserted", "type": "property"}, {"access": "private", "host": "Loader", "name": "_internalCallback", "url": "Loader.html#property__internalCallback", "type": "property"}, {"access": "", "host": "Lang", "name": "isArray", "url": "Lang.html#method_isArray", "type": "method"}, {"access": "", "host": "Lang", "name": "isBoolean", "url": "Lang.html#method_isBoolean", "type": "method"}, {"access": "", "host": "Lang", "name": "isDate", "url": "Lang.html#method_isDate", "type": "method"}, {"access": "", "host": "Lang", "name": "isFunction", "url": "Lang.html#method_isFunction", "type": "method"}, {"access": "", "host": "Lang", "name": "isNull", "url": "Lang.html#method_isNull", "type": "method"}, {"access": "", "host": "Lang", "name": "isNumber", "url": "Lang.html#method_isNumber", "type": "method"}, {"access": "", "host": "Lang", "name": "isObject", "url": "Lang.html#method_isObject", "type": "method"}, {"access": "", "host": "Lang", "name": "isString", "url": "Lang.html#method_isString", "type": "method"}, {"access": "", "host": "Lang", "name": "isUndefined", "url": "Lang.html#method_isUndefined", "type": "method"}, {"access": "", "host": "Lang", "name": "isValue", "url": "Lang.html#method_isValue", "type": "method"}, {"access": "", "host": "config", "name": "jsAttributes", "url": "config.html#property_jsAttributes", "type": "property"}, {"access": "", "host": "Loader", "name": "jsAttributes", "url": "Loader.html#property_jsAttributes", "type": "property"}, {"access": "", "host": "YUI", "name": "key", "url": "YUI.html#event_key", "type": "event"}, {"access": "", "host": "Object", "name": "keys", "url": "Object.html#method_keys", "type": "method"}, {"access": "", "host": "YUI", "name": "later", "url": "YUI.html#method_later", "type": "method"}, {"access": "private", "host": "Get", "name": "_linkNode", "url": "Get.html#method__linkNode", "type": "method"}, {"access": "", "host": "Loader", "name": "loaded", "url": "Loader.html#property_loaded", "type": "property"}, {"access": "", "host": "Loader", "name": "loadNext", "url": "Loader.html#method_loadNext", "type": "method"}, {"access": "", "host": "Loader", "name": "loadOptional", "url": "Loader.html#property_loadOptional", "type": "property"}, {"access": "", "host": "config", "name": "locale", "url": "config.html#property_locale", "type": "property"}, {"access": "", "host": "YUI", "name": "log", "url": "YUI.html#method_log", "type": "method"}, {"access": "", "host": "config", "name": "logExclude", "url": "config.html#property_logExclude", "type": "property"}, {"access": "", "host": "config", "name": "logInclude", "url": "config.html#property_logInclude", "type": "property"}, {"access": "", "host": "YUI", "name": "merge", "url": "YUI.html#method_merge", "type": "method"}, {"access": "", "host": "YUI", "name": "message", "url": "YUI.html#method_message", "type": "method"}, {"access": "", "host": "YUI", "name": "mix", "url": "YUI.html#method_mix", "type": "method"}, {"access": "", "host": "UA", "name": "mobile", "url": "UA.html#property_mobile", "type": "property"}, {"access": "", "host": "Loader", "name": "moduleInfo", "url": "Loader.html#property_moduleInfo", "type": "property"}, {"access": "", "host": "config", "name": "modules", "url": "config.html#property_modules", "type": "property"}, {"access": "", "host": "YUI", "name": "mouseenter", "url": "YUI.html#event_mouseenter", "type": "event"}, {"access": "", "host": "YUI", "name": "mouseleave", "url": "YUI.html#event_mouseleave", "type": "event"}, {"access": "", "host": "YUI", "name": "namespace", "url": "YUI.html#method_namespace", "type": "method"}, {"access": "private", "host": "Get", "name": "_next", "url": "Get.html#method__next", "type": "method"}, {"access": "private", "host": "Get", "name": "_node", "url": "Get.html#method__node", "type": "method"}, {"access": "", "host": "Array", "name": "numericSort", "url": "Array.html#method_numericSort", "type": "method"}, {"access": "", "host": "config", "name": "onCSS", "url": "config.html#property_onCSS", "type": "property"}, {"access": "", "host": "Loader", "name": "onCSS", "url": "Loader.html#method_onCSS", "type": "method"}, {"access": "", "host": "Loader", "name": "onFailure", "url": "Loader.html#method_onFailure", "type": "method"}, {"access": "", "host": "Loader", "name": "onProgress", "url": "Loader.html#method_onProgress", "type": "method"}, {"access": "", "host": "Loader", "name": "onSuccess", "url": "Loader.html#method_onSuccess", "type": "method"}, {"access": "", "host": "Loader", "name": "onTimeout", "url": "Loader.html#method_onTimeout", "type": "method"}, {"access": "", "host": "UA", "name": "opera", "url": "UA.html#property_opera", "type": "property"}, {"access": "", "host": "UA", "name": "os", "url": "UA.html#property_os", "type": "property"}, {"access": "", "host": "Object", "name": "owns", "url": "Object.html#method_owns", "type": "method"}, {"access": "", "host": "config", "name": "pollInterval", "url": "config.html#property_pollInterval", "type": "property"}, {"access": "private", "host": "Get", "name": "_purge", "url": "Get.html#method__purge", "type": "method"}, {"access": "private", "host": "Get", "name": "PURGE_THRESH", "url": "Get.html#property_PURGE_THRESH", "type": "property"}, {"access": "", "host": "config", "name": "purgethreshold", "url": "config.html#property_purgethreshold", "type": "property"}, {"access": "private", "host": "Get", "name": "purging", "url": "Get.html#property_purging", "type": "property"}, {"access": "private", "host": "Get", "name": "qidx", "url": "Get.html#property_qidx", "type": "property"}, {"access": "private", "host": "Get", "name": "queue", "url": "Get.html#method_queue", "type": "method"}, {"access": "private", "host": "Get", "name": "queues", "url": "Get.html#property_queues", "type": "property"}, {"access": "private", "host": "Loader", "name": "_reduce", "url": "Loader.html#method__reduce", "type": "method"}, {"access": "", "host": "Loader", "name": "require", "url": "Loader.html#method_require", "type": "method"}, {"access": "", "host": "Loader", "name": "required", "url": "Loader.html#property_required", "type": "property"}, {"access": "private", "host": "Get", "name": "_returnData", "url": "Get.html#method__returnData", "type": "method"}, {"access": "private", "host": "Loader", "name": "_rollup", "url": "Loader.html#method__rollup", "type": "method"}, {"access": "", "host": "Loader", "name": "rollups", "url": "Loader.html#property_rollups", "type": "property"}, {"access": "", "host": "config", "name": "root", "url": "config.html#property_root", "type": "property"}, {"access": "", "host": "Loader", "name": "root", "url": "Loader.html#property_root", "type": "property"}, {"access": "", "host": "Get", "name": "script", "url": "Get.html#method_script", "type": "method"}, {"access": "private", "host": "Get", "name": "_scriptNode", "url": "Get.html#method__scriptNode", "type": "method"}, {"access": "", "host": "UA", "name": "secure", "url": "UA.html#property_secure", "type": "property"}, {"access": "", "host": "config", "name": "secureBase", "url": "config.html#property_secureBase", "type": "property"}, {"access": "private", "host": "YUI", "name": "_setup", "url": "YUI.html#method__setup", "type": "method"}, {"access": "private", "host": "Loader", "name": "_setup", "url": "Loader.html#method__setup", "type": "method"}, {"access": "", "host": "Object", "name": "setValue", "url": "Object.html#method_setValue", "type": "method"}, {"access": "", "host": "YUI", "name": "simulate", "url": "YUI.html#method_simulate", "type": "method"}, {"access": "", "host": "Object", "name": "size", "url": "Object.html#method_size", "type": "method"}, {"access": "", "host": "Loader", "name": "skin", "url": "Loader.html#property_skin", "type": "property"}, {"access": "", "host": "Loader", "name": "skipped", "url": "Loader.html#property_skipped", "type": "property"}, {"access": "", "host": "Array", "name": "some", "url": "Array.html#method_some", "type": "method"}, {"access": "private", "host": "Loader", "name": "_sort", "url": "Loader.html#method__sort", "type": "method"}, {"access": "", "host": "Loader", "name": "sorted", "url": "Loader.html#property_sorted", "type": "property"}, {"access": "", "host": "YUI", "name": "stamp", "url": "YUI.html#method_stamp", "type": "method"}, {"access": "", "host": "Array", "name": "test", "url": "Array.html#method_test", "type": "method"}, {"access": "", "host": "config", "name": "throwFail", "url": "config.html#property_throwFail", "type": "property"}, {"access": "", "host": "config", "name": "timeout", "url": "config.html#property_timeout", "type": "property"}, {"access": "private", "host": "Get", "name": "_timeout", "url": "Get.html#method__timeout", "type": "method"}, {"access": "", "host": "Loader", "name": "timeout", "url": "Loader.html#property_timeout", "type": "property"}, {"access": "private", "host": "Get", "name": "_track", "url": "Get.html#method__track", "type": "method"}, {"access": "", "host": "Lang", "name": "trim", "url": "Lang.html#method_trim", "type": "method"}, {"access": "", "host": "Lang", "name": "type", "url": "Lang.html#method_type", "type": "method"}, {"access": "private", "host": "Loader", "name": "_url", "url": "Loader.html#method__url", "type": "method"}, {"access": "", "host": "YUI", "name": "use", "url": "YUI.html#method_use", "type": "method"}, {"access": "", "host": "config", "name": "useBrowserConsole", "url": "config.html#property_useBrowserConsole", "type": "property"}, {"access": "private", "host": "Loader", "name": "_useYahooListener", "url": "Loader.html#property__useYahooListener", "type": "property"}, {"access": "", "host": "Object", "name": "values", "url": "Object.html#method_values", "type": "method"}, {"access": "", "host": "UA", "name": "webkit", "url": "UA.html#property_webkit", "type": "property"}, {"access": "", "host": "config", "name": "win", "url": "config.html#property_win", "type": "property"}, {"access": "", "host": "YUI", "name": "windowresize", "url": "YUI.html#event_windowresize", "type": "event"}, {"access": "", "host": "config", "name": "windowResizeDelay", "url": "config.html#property_windowResizeDelay", "type": "property"}];
</script>
</body>
</html>
